<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
    <title>松鼠咨询</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/tutor.css">
    <link rel="shortcut icon" href="https://chuangkun.oss-cn-hangzhou.aliyuncs.com/icon/favicon.ico">
    <script>
        !(function() {
            function w() {
                var r = document.documentElement;
                var a = r.getBoundingClientRect().width;
                if (a > 1080) {
                    a = 1080;
                }
                rem = a / 1080 * 300;
                r.style.fontSize = rem + "px"
            }
            var t;
            w();
            window.addEventListener("resize", function() {
                clearTimeout(t);
                t = setTimeout(w, 300)
            }, false);

        }())
    </script>
</head>

<body>
    <div id="box">
        <h1>
            <a href="javascript:void(-1);"></a>
            你的专属导师
        </h1>
        <div id="content">
            <img src="./img/tutor_a.png" alt="">
        </div>
        <div id="bottom">
            <img src="./img/tutor_b.png" alt="">
            <span>abcdef123c</span>
            <button></button>
        </div>
    </div>

    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>

    <script>
        function a(obj) {
            return console.log(obj)
        }
        $("button").click(function() {
            console.log("点击了");
            var html = $("span").html();
            copyTextToClipboard(html);

        })

        // 支付宝插件
        function copyTextToClipboard(text) {
            var textArea = document.createElement("textarea")
            textArea.style.position = 'fixed'
            textArea.style.top = 0
            textArea.style.left = 0
            textArea.style.width = '2em'
            textArea.style.height = '2em'
            textArea.style.padding = 0
            textArea.style.border = 'none'
            textArea.style.outline = 'none'
            textArea.style.boxShadow = 'none'
            textArea.style.background = 'transparent'
            textArea.value = text

            document.body.appendChild(textArea)

            textArea.select()

            try {
                var msg = document.execCommand('copy') ? '成功' : '失败'
                    // alert('复制内容 ' + msg);
                console.log('复制内容 ' + msg)
            } catch (err) {
                // alert('不能使用这种方法复制内容');
                console.log('不能使用这种方法复制内容')
            }

            document.body.removeChild(textArea)
        }
    </script>
</body>

</html>